package cn.avalon.feign;

import cn.avalon.domain.JsonResult;
import cn.avalon.domain.Movie;
import cn.avalon.dto.MovieDto;
import cn.avalon.dto.WatchMovieDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @description:
 * @author: Avalon
 * @date: 2022年09月25日 ： 15:39
 * @version: ver1.0
 * @email 709785494@qq.com
 */
@FeignClient(value = "service-movie", path = "/movie")
public interface MovieService {

    @GetMapping("/{id}")
    Movie findById(@PathVariable("id") Long id);

    @PostMapping("/buy")
    JsonResult buyMovie(@RequestBody MovieDto movieDto);

    @PostMapping("/watchMovie")
    JsonResult watchMovie(@RequestBody WatchMovieDto watchMovieDto);
}
